from django.contrib import admin

# Register your models here.
from resources.models import Chassis,Server,Switch,Tester,Card,CableAndTransceiver,TrafficPC,RMA,LendAndBorrow,PowerManagement

class ChassisAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
    list_display = ('Category','Description','SN','Status','Location','Name','Owner') ###### display less for clear check on web ######
#    list_display = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
#    list_display_links = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
    list_filter = ('Category','Status')
admin.site.register(Chassis,ChassisAdmin)

class ServerAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','SN','Status','Location','Name','Version','Owner','Ucs','Comment')
    list_display = ('Category','Description','SN','Status','Location','Name','Version','Owner') ###### display less for clear check on web ######
    list_filter = ('Category','Status')
admin.site.register(Server,ServerAdmin)

class SwitchAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','SN','Status','Location','Name','Comment','Update_Time')
    list_display = ('Category','Description','SN','Status','Location','Name','Comment','Update_Time') ###### display less for clear check on web ######
    list_filter = ('Category','Status')
admin.site.register(Switch,SwitchAdmin)

class TesterAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','SN','Status','Location','Mgt','Comment')
    list_display = ('Category','Description','SN','Status','Location','Mgt','Comment') ###### display less for clear check on web ######
    list_filter = ('Category','Status')
admin.site.register(Tester,TesterAdmin)

class CardAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','SN','Status','Location','Comment')
    list_display = ('Category','Description','SN','Status','Location','Comment') ###### display less for clear check on web ######
    list_filter = ('Category','Status')
admin.site.register(Card,CardAdmin)

class CableAndTransceiverAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','Qty','SN','Status','PR','RecDate','Location','Comment')
    list_display = ('Category','Description','Qty','RecDate','Location','Comment') ###### display less for clear check on web ######
admin.site.register(CableAndTransceiver,CableAndTransceiverAdmin)

class TrafficPCAdmin(admin.ModelAdmin):
    search_fields = ('Name','IXIA_API','Spirent_API','Comment')
    list_display = ('Name','IXIA_API','Spirent_API','Comment') 
admin.site.register(TrafficPC,TrafficPCAdmin)

class RMAAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
    list_display = ('Category','Description','SN','Status','Location','Name','Owner') ###### display less for clear check on web ######
#    list_display = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
#    list_display_links = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
    list_filter = ('Category','Status')
admin.site.register(RMA,RMAAdmin)

class LendAndBorrowAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
    list_display = ('Category','Description','SN','Status','Location','Name','Owner') ###### display less for clear check on web ######
#    list_display = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
#    list_display_links = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
    list_filter = ('Category','Status')
admin.site.register(LendAndBorrow,LendAndBorrowAdmin)

class PowerManagementAdmin(admin.ModelAdmin):
    search_fields = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
    list_display = ('Category','Description','SN','Status','Location','Name','Owner') ###### display less for clear check on web ######
#    list_display = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
#    list_display_links = ('Category','Description','SN','Status','Location','Name','Owner','Ucs','Comment')
    list_filter = ('Category','Status')
admin.site.register(PowerManagement,PowerManagementAdmin)
